<?php
/**
 * Created by PhpStorm.
 * User: 共赢岛
 * Date: 2023/12/7
 * Time: 16:49
 */

namespace App\Http\Controllers\API\LifeCycle\Package;

use App\Http\Controllers\Controller;
use App\Http\Resources\PackageBrandCollection;
use App\Http\Resources\PackageBrandResource;
use App\Services\LifeCycle\BrandService;
use Illuminate\Http\Request;

class BrandController extends  Controller
{
    public function index(Request $request)
    {
        $param = $request->all();
        $package_type = $param['package_type'];

        $brand = BrandService::index($package_type);

        if ($brand) {
            return $this->success(PackageBrandResource::collection($brand));
        } else {
            return $this->failure();
        }
    }
}